calculates linear interpolation between real numbers. Output is a double real
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=float), | intent(in) | :: | x1 | |||
real(kind=float), | intent(in) | :: | x2 | |||
real(kind=double), | intent(in) | :: | y1 | |||
real(kind=double), | intent(in) | :: | y2 | |||
real(kind=float), | intent(in) | :: | x |
FUNCTION LinearInterpFloatDouble & ( x1, x2, y1, y2, x ) & RESULT (y) IMPLICIT NONE ! Function arguments ! Scalar arguments with intent(in): REAL (KIND = float), INTENT (IN) :: x1, x2, x REAL (KIND = double), INTENT (IN) :: y1, y2 ! Scalar arguments with intent (out): REAL (KIND = double) :: y !------------end of declaration------------------------------------------------ y = y1 + ( y2 - y1 ) / ( x2 - x1 ) * ( x - x1 ) END FUNCTION LinearInterpFloatDouble